home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Directorty Opus 5 - Magellan
/
Opus 5 - Magellan.iso
/
Extras
/
Install_3.3
/
ARexx
/
Install_Preferences.dopus5
< prev
next >
Wrap
Text File
|
1997-05-09
|
4KB
|
200 lines
/* $VER: Install_Preferences.dopus5 3.1 (09.05.97) © Frédéric Steinfels
*/
Init:
libname = "rexxdossupport.library"
if ~show("L", libname) then do
if ~addlib(libname, 0, -30, 2) then do
say libname "not added!"
exit
end
end
libname = "rexxtricks.library"
if ~show("L", libname) then do
if ~addlib(libname, 0, -30) then do
say libname "not added!"
exit
end
end
libname = "rexxsupport.library"
if ~show("L", libname) then do
if ~addlib(libname, 0, -30) then do
say libname "not added!"
exit
end
end
libname = "locale.library"
if ~show("L", libname) then do
if ~addlib(libname, 0, -30) then do
say libname "not added!"
exit
end
end
signal on BREAK_C
signal on BREAK_D
signal on BREAK_E
signal on BREAK_F
signal on HALT
signal on IOERR
signal on SYNTAX
signal on FAILURE
options failat 21
options results
catalog=opencatalog('Install.dopus5.catalog','english',0)
p.1=WRITECOMS
n.1=NOWRITECOMS
d.1='write Comment to Source'
p.2=WRITECOMD
n.2=NOWRITECOMD
d.2='write Comment to Destination'
p.3=REPLACES
n.3=NOREPLACES
d.3='replace Files on Source'
p.4=REPLACED
n.4=NOREPLACED
d.4='replace Files on Destination'
p.5=AUTOREPLACES
n.5=NOAUTOREPLACES
d.5='auto replace Files on Source'
p.6=AUTOREPLACED
n.6=NOAUTOREPLACED
d.6='auto replace Files on Destination'
p.7=COMPLETES
n.7=NOCOMPLETES
d.7='complete Source Directory'
p.8=COMPLETED
n.8=NOCOMPLETED
d.8='complete Destination Directory'
p.9=CICONS
n.9=NOCICONS
d.9='compare Icons'
p.10=SIZE
n.10=NOSIZE
d.10='Size must be greater'
p.11=FDATE
n.11=NOFDATE
d.11='FileDate must be higher'
p.12=VDATE
n.12=NOVDATE
d.12='VersionDate must be higher'
p.13=BASE
n.13=NOBASE
d.13='BaseName must be the same'
p.14=VERSION
n.14=NOVERSION
d.14='Version must be higher'
parse arg arguments
ProgramName = "Install_Preferences.dopus5";
ArgsTemplate = "PORT/A,PREFSFILE/A,SHOWSETTINGS/S,WRITECOMS/S,WRITECOMD/S,REPLACES/S,REPLACED/S,AUTOREPLACES/S,AUTOREPLACED/S,COMPLETES/S,COMPLETED/S,CICONS/S,SIZE/S,FDATE/S,VDATE/S,BASE/S,VERSION/S,NOWRITECOMS/S,NOWRITECOMD/S,NOREPLACES/S,NOREPLACED/S,NOAUTOREPLACES/S,NOAUTOREPLACED/S,NOCOMPLETES/S,NOCOMPLETED/S,NOCICONS/S,NOSIZE/S,NOFDATE/S,NOVDATE/S,NOBASE/S,NOVERSION/S"
lf='0a'x
if strip(arguments) = '?' then do
Call WriteCh(STDOUT, ArgsTemplate || ': ')
pull arguments
end; else nop
if ~ReadArgs(arguments,ArgsTemplate) then do
say Fault(RC,ProgramName)
exit 10
end; else nop
drop arguments
address value PORT
if ~open(prefs,PREFSFILE,'READ') then do
ln=COPIES('1',14)
end
else do
ln=readln(prefs)
cnt=1
do while cnt<15
if substr(ln,cnt,1)~='0' & substr(ln,cnt,1)~='1' then do
ln=overlay('1',ln,cnt)
end
cnt=cnt+1
end
Call Close(prefs)
end
cnt=1
do while cnt<15
if VALUE(p.cnt)=1 then do
ln=overlay('1',ln,cnt)
end
if VALUE(n.cnt)=1 then do
ln=overlay('0',ln,cnt)
end
cnt=cnt+1
end
if ~open(prefs,PREFSFILE,'WRITE') then do
dopus request '"' || GetCatStr(15,'Unable to open') PREFSFILE || '"' GetCatStr(0,'Abort')
exit
end
if SHOWSETTINGS=1 then do
req=GetCatStr(16,'Actions:') || lf || lf
cnt=1
do while cnt<10
if substr(ln,cnt,1)=1 then do
req=req || GetCatStr(cnt,d.cnt) || '0a'x
end
cnt=cnt+1
end
if length(req)>0 then req=left(req,length(req)-1)
dopus request '"' || req || '"'
req=GetCatStr(17,'auto replace Criteriums:') || lf || lf
cnt=10
do while cnt<15
if substr(ln,cnt,1)=1 then do
req=req || GetCatStr(cnt,d.cnt) || '0a'x
end
cnt=cnt+1
end
if length(req)>0 then req=left(req,length(req)-1)
dopus request '"' || req || '"'
end
Call WriteLn(prefs,ln)
Call Close(prefs)
call CloseCatalog(catalog)
exit
ERROR:
HALT:
IOERR:
SYNTAX:
IF RC ~= 0 THEN DO
line=sigl
text=errortext(rc)
dopus request '"' || GetCatStr(18,'Error in') ProgramName || lf || text || lf || GetCatStr(19,'Line') line || '"' GetCatStr(0,'Abort')
END
else do
dopus request '"' || GetCatStr(18,'Error in') ProgramName || '"' GetCatStr(0,'Abort')
end
BREAK_C:
BREAK_D:
BREAK_E:
BREAK_F:
call CloseCatalog(catalog)
exit
getcatstr: /* Thank you for this procedure, Edmund */
parse arg msgno,msgstring
if catalog~=0 then
msgstring=getcatalogstr(catalog,msgno,msgstring)
do i=3 to arg()
parse var msgstring fore '%s' aft
msgstring=fore||arg(i)||aft
end
return msgstring